﻿using System.Collections.Generic;
using System.Windows.Forms;
using xfsale.lib;

namespace xfsale.ui
{
    public partial class WinBase : DevExpress.XtraEditors.XtraForm
    {
        public WinBase()
        {
            InitializeComponent();
        }

        protected override bool ProcessCmdKey(ref   Message msg, Keys keyData)
        {
            if (!(ActiveControl is Button) && !(ActiveControl is DevExpress.XtraEditors.BaseButton))
            {
                if (keyData == Keys.Enter || keyData == Keys.Down)
                {
                    SendKeys.Send("{TAB}");
                    return true;
                }

                if (keyData == Keys.Up)
                {
                    SendKeys.Send("+{Tab}");
                    return true;
                }
            }

            return base.ProcessCmdKey(ref   msg, keyData);
        }
    }
}
